package com.ll.beautymall.ui.home.homefragment.presenter;

import com.ll.beautymall.bean.NavList;
import com.ll.beautymall.ui.home.homefragment.model.NavBiz;
import com.ll.beautymall.ui.home.homefragment.model.OnGetNavResultLisenter;
import com.ll.beautymall.ui.home.homefragment.view.IHomeView;

/**
 * Created by Administrator on 2016/10/20.
 */
public class NavPresenter {
    private NavBiz navBiz;
    private IHomeView homeView;

    public NavPresenter(IHomeView view) {
        navBiz = new NavBiz();
        homeView = view;
    }

    public void setNavData() {
        navBiz.getNavData(new OnGetNavResultLisenter() {
            @Override
            public void onSucced(NavList navList) {
                if (navList != null && homeView != null) {
                    homeView.setNavData(navList);
                }
            }

            @Override
            public void onFailed(String errorMsg) {
                homeView.showErrorMsg(errorMsg);
            }
        });
    }
}
